package motor;

public class ModuleProduire
{
	private Motor	m;
	private Unite	umere;
	
	private int delay;

	public ModuleProduire(Motor m , Unite u )
	{
		this.m = m;
		this.umere = u;
	}

	public void produire(int type)
	{
		if( delay < m.getTimer() )
		{
			
			m.achat(umere , umere.getCamp() , type);
			
			if( type == 0 )
				delay  = m.getTimer() + Unite.DELAY_0;
			else if( type == 0 )
				delay  = m.getTimer() + Unite.DELAY_1;
		}
	}
}
